//N3超时
let nums = [24,3,82,22,35,84,19]
var triangleNumber = function(nums) {
    let result=0
     nums.sort((a, b) => a - b);
    for(let i=0;i<nums.length-2;i++){
        for(let j=i+1;j<nums.length-1;j++){
            for(let z=j+1;z<nums.length;z++){
                if(nums[z]<(nums[i]+nums[j])){
                    result++
                }
            }
        }
    }
    return result
};
console.log(triangleNumber(nums));
